package com.xingdata.jjxc.adapter;

import java.util.List;

import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.xingdata.jjxc.R;
import com.xingdata.jjxc.enty.CircuLationEntity;

public class CircuLationAdp extends BaseAdapter {
	private CircuLationEntity circuLationEntity;
	private List<CircuLationEntity> circuLationEntities;
	private Context context;

	public CircuLationAdp(FragmentActivity activity,
			List<CircuLationEntity> circuLationEntities) {
		this.context = activity;
		this.circuLationEntities = circuLationEntities;
	}

	@Override
	public int getCount() {
		return circuLationEntities == null ? 0 : circuLationEntities.size();
	}

	@Override
	public CircuLationEntity getItem(int position) {
		return circuLationEntities.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		Holder mholder = null;
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(R.layout.viodeo,
					null);
			mholder = new Holder();
			mholder.voide_iv = (ImageView) convertView
					.findViewById(R.id.voide_iv);
			mholder.videodate_tv = (TextView) convertView
					.findViewById(R.id.videodate_tv);
			mholder.textimage1_iv = (ImageView) convertView
					.findViewById(R.id.textimage1_iv);
			mholder.viodetext = (TextView) convertView
					.findViewById(R.id.viodetext);
			mholder.textimage2_iv = (ImageView) convertView
					.findViewById(R.id.textimage2_iv);
			convertView.setTag(mholder);
		} else {
			mholder = (Holder) convertView.getTag();
		}
		circuLationEntity = circuLationEntities.get(position);
		mholder.videodate_tv.setText(circuLationEntity.getCirculationdate());
		return convertView;

	}

	class Holder {
		private TextView videodate_tv, viodetext;
		private ImageView voide_iv, textimage1_iv, textimage2_iv;
	}
}
